<script lang="ts" setup>
import { ref } from 'vue'

const activeIndex = ref('1')
const handleSelect = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
}
</script>

<template>
    <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">

        <el-menu-item index="1">功能1</el-menu-item>
        <el-sub-menu index="2">
            <template #title>功能2</template>
            <el-menu-item index="2-1">功能2-1</el-menu-item>
            <el-menu-item index="2-2">功能2-1</el-menu-item>
            <el-menu-item index="2-3">功能2-3</el-menu-item>
            <el-sub-menu index="2-4">
                <template #title>功能2-4</template>
                <el-menu-item index="2-4-1">功能2-4-1</el-menu-item>
                <el-menu-item index="2-4-2">功能2-4-2</el-menu-item>
                <el-menu-item index="2-4-3">功能2-4-3</el-menu-item>
            </el-sub-menu>
        </el-sub-menu>
        <el-menu-item index="3" disabled>功能3</el-menu-item>
        <el-menu-item index="4">功能4</el-menu-item>
    </el-menu>
</template>

  